<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<!-- ko if: (canInitialise())-->
<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
    <div class="payment-method-title field choice">
        <input type="radio"
               name="payment[method]"
               class="radio"
               data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()" />
        <label class="label" data-bind="attr: {'for': getCode()}">
            <span data-bind="text: getTitle()"></span>
        </label>
    </div>

    <div class="payment-method-content">
        <!-- ko foreach: getRegion('messages') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->
        <fieldset class="fieldset" data-bind='attr: {id: "payment_form_" + getCode()}'>
            <div data-bind="afterRender: initPayPalContainer.bind($data)"></div>
        </fieldset>
        <div class="checkout-agreements-block">
            <!-- ko foreach: $parent.getRegion('before-place-order') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>
        <!-- ko if: isValid() -->
        <div class="actions-toolbar">
            <div class="primary">
                <button data-role="review-save"
                        type="submit"
                        data-bind="
                        attr: {title: $t('Place Order')},
                        enable: (getCode() == isChecked()),
                        click: placeOrder"
                        class="action primary checkout"
                        disabled>
                    <span data-bind="i18n: 'Place Order'"></span>
                </button>
            </div>
        </div>
        <!--/ko-->
    </div>
</div>
<!-- /ko -->
